xencommons: modprobe xenfs if it not be loaded
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 21 Jun 2010 08:57:10 +0000 (09:57 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 21 Jun 2010 08:57:10 +0000 (09:57 +0100)
If xenfs is compiled as a module, now cannot complete
'service xencommons start', modprobe xenfs can fix it.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
tools/hotplug/Linux/init.d/xencommons

index d8680fba02d4a4e39e96881448b1adf0de222f99..6885cb924c8b5d06f6667a4910a5f0acf1a4c230 100644 (file)
@@ -24,16 +24,21 @@ test -f /etc/sysconfig/xencommons && . /etc/sysconfig/xencommons
 XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
 shopt -s extglob
 
-if test "x$1" = xstart && \
-     test -d /proc/xen && \
-   ! test -d /proc/xen/capabilities && \
-     grep '    xenfs$' /proc/filesystems >/dev/null && \
-   ! grep '^xenfs ' /proc/mounts >/dev/null;
-then
-       mount -t xenfs xenfs /proc/xen
+if test "x$1" = xstart; then
+       if ! grep '     xenfs$' /proc/filesystems >/dev/null; then
+               test -x /sbin/modprobe && /sbin/modprobe xenfs 2>/dev/null
+       fi
+       if test -d /proc/xen && \
+           ! test -d /proc/xen/capabilities && \
+             grep '    xenfs$' /proc/filesystems >/dev/null && \
+           ! grep '^xenfs ' /proc/mounts >/dev/null;
+       then
+               mount -t xenfs xenfs /proc/xen
+       fi
 fi
 
-if ! grep -q "control_d" /proc/xen/capabilities ; then
+if ! test -e /proc/xen/capabilities || \
+    ! grep -q "control_d" /proc/xen/capabilities ; then
        exit 0
 fi